<blockquote class="layui-elem-quote">
    <div class="layui-inline">
        <i class="layui-icon layui-icon-list layui-head-icon"></i>
        <span class="layui-font-16 layui-font-green">会员信息</span>
    </div>
</blockquote>
<div class="layui-card">
    <div class="layui-card-body">
    <form class="layui-form">
        <input type="hidden" name="id" value="{$row.id}">
       <div class="layui-form-item">
          <label class="layui-form-label">用户昵称</label>
          <div class="layui-input-block">
            <input type="text" disabled value="{$row.nickname}" class="layui-input">
          </div>
        </div>
        <div class="layui-form-item">
          <label class="layui-form-label">用户头像</label>
          <div class="layui-input-block">
            <img src="{notempty name='row.avatar'} {$row.avatar} {else/} /static/admin/img/upimg.png {/notempty}" class="layui-upimg layui-circle">
          </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">性别</label>
            <div class="layui-input-block">
                <input type="text" disabled value="{$row.gender}" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">出生年月日</label>
            <div class="layui-input-block">
                <input type="text" disabled value="{$row.birthday}" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">余额</label>
            <div class="layui-input-block">
                <input type="text" disabled value="{$row.balance}" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">金豆</label>
            <div class="layui-input-block">
                <input type="text" disabled value="{$row.gold}" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">积分</label>
            <div class="layui-input-block">
                <input type="text" disabled value="{$row.integral}" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
          <label class="layui-form-label">手机号</label>
          <div class="layui-input-block">
            <input type="text" disabled value="{$row.phone}" class="layui-input">
          </div>
        </div>
        <div class="layui-form-item">
          <label class="layui-form-label">会员等级</label>
          <div class="layui-input-block">
              <select class="layui-select" name="store_user_grade_id" id="store-user-grade-id">
                {foreach $gradeOptions as $opt}
                    <option value="{$opt.id}">{$opt.grade_name}</option>
                 {/foreach}   
              </select>
          </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">注册时间</label>
            <div class="layui-input-block">
                <input type="text" disabled value="{$row.register_time}" class="layui-input">
            </div>
        </div>
      <div class="layui-form-item">
        <div class="layui-input-block">
          <button class="layui-btn" lay-submit lay-filter="formAdd">立即提交</button>
        </div>
      </div>
    </form>
  </div>
</div>
  

<script>
    //Demo
    layui.use(['form','upload'], function(){
      var $ = layui.jquery,form = layui.form,upload = layui.upload;

      $('#store-user-grade-id').val('{$row.user_grade_id}');

      form.render('select');

      form.on('submit(formAdd)', function(data){
            $.post('/store/user/update',data.field,function(res){
                if(res.code == 1){
                  layer.msg(res.msg,{icon: 2});
                  var index = parent.layer.getFrameIndex(window.name);
                  parent.layer.close(index);
                  parent.$.pjax.reload('#main',{fragment: '#main'});
                }
                if(res.code ==0 ){
                    layer.msg(res.msg);
                }
            });
          
          return false;
        });
    });
    </script>
</body>
</html>
